package com.wiznbiz.okagent;

import android.app.*;
import android.content.*;
import android.text.method.*;
import android.view.*;
import android.widget.*;


/**
 * 커스텀 Progress Dialog 클래스
 * 
 * @author Administrator
 *
 */
public class CustomProgressDialog extends Dialog  {
	Context context;
	View v = null;
	TextView tvMessage;
	ProgressBar progressBar;
	
	public CustomProgressDialog(Context context) {
		super(context);
		this.context = context;
		
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		
		setContentView(R.layout.progress_dialog);
		
		v = getWindow().getDecorView();
		v.setBackgroundResource(android.R.color.transparent);
		
		tvMessage = (TextView) findViewById(R.id.tv_message);
		tvMessage.setVisibility(View.GONE);
		
		progressBar = (ProgressBar) findViewById(R.id.progress);
	}
	
	/**
	 * 
	 */
	@Override
	public void setTitle(CharSequence title) {
	    super.setTitle(title);
	}
	
	/**
	 * 
	 */
	@Override
	public void setTitle(int titleId) {
	    super.setTitle(titleId);
	}
	
	
	/**
	 * 
	 * @param message
	 */
	public void setMessage(CharSequence message) {
		tvMessage.setText(message);
		tvMessage.setVisibility(View.VISIBLE);
		tvMessage.setMovementMethod(ScrollingMovementMethod.getInstance());
	}

	/**
	 * 
	 * @param messageId
	 */
	public void setMessage(int messageId) {
		tvMessage.setText(this.context.getResources().getString(messageId));
		tvMessage.setVisibility(View.VISIBLE);
		tvMessage.setMovementMethod(ScrollingMovementMethod.getInstance());
	}

}
